import type { TableColumn } from '@/framework/components/core/super-table';
import dayjs from 'dayjs';

export type TableListItem = {
  id: string;
  timeRange: any;
  month: string;
  tmpInCount: string;
  tmpOutCount: string;
  saveInCount: string;
  saveOutCount: string;
};
export type TableColumnItem = TableColumn<TableListItem>;

export const baseColumns: TableColumnItem[] = [
  {
    title: '时间范围',
    field: 'timeRange',
    formItemProps: {
      component: 'RangePicker',
      componentProps: {
        picker: 'month',
        valueFormat: 'YYYY-MM-01',
      },
    },
    hideInTable: true,
  },
  {
    type: 'seq',
    title: '序号',
    width: 60,
  },
  {
    title: '月份',
    field: 'month',
    formatter: ({ cellValue }) => {
      return cellValue ? dayjs(cellValue).format('YYYY-MM') : '-';
    },
    hideInSearch: true,
  },
  // {
  //   title: '暂存入库',
  //   field: 'tmpInCount',
  //   hideInSearch: true,
  // },
  // {
  //   title: '暂存出库',
  //   field: 'tmpOutCount',
  //   hideInSearch: true,
  // },
  {
    title: '保藏入库（株）',
    field: 'saveInCount',
    hideInSearch: true,
  },
  {
    title: '保藏出库（株）',
    field: 'saveOutCount',
    hideInSearch: true,
  },
];
